package me.zhengjie.modules.biz.rest;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.biz.domain.NewExamDict;
import me.zhengjie.modules.biz.domain.vo.NewExamDictQueryCriteria;
import me.zhengjie.modules.biz.service.NewExamDictService;
import me.zhengjie.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 新高考模块 ： 微信小程序使用
 */

@RestController
@RequiredArgsConstructor
@Api(tags = "专业：单招指导（字典）管理")
@RequestMapping("/api/newExam")
@Slf4j
public class NewExamController {

    private final NewExamDictService newExamDictService;

    @PostMapping("/dict")
    @Log("查询新高考指导目录")
    @ApiOperation("查询新高考指导目录")
    public ResponseEntity<PageResult<NewExamDict>> dict(@Validated  @RequestBody NewExamDictQueryCriteria criteria) {
        log.info("/api/newExam/dict 查询新高考指导目录:{}",criteria);
        return new ResponseEntity<>(newExamDictService.queryAll(criteria,criteria.getPage()), HttpStatus.OK);
    }


}
